package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	JwtToken
	SmsCode
}

type JwtToken struct {
	AccessSecret string
	AccessExpire int64
}

type SmsCode struct {
	APIID  string
	APIKEY string
}

var AppData AppConfig

func InitAppConfigApi() {
	viper.SetConfigFile("./appconfig/config.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("获取缓存文件失败", err)
		return
	}
	viper.Unmarshal(&AppData)
	fmt.Println("获取缓存文件成功", AppData)

}
